const { src, dest } = require('gulp');
const scss = require('gulp-sass');
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
const minifyCSS = require('gulp-minify-css');

// scss 解析
function goscss() {
    return src('src/scss/*.scss')
        .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') })) // 解析错误提示
        .pipe(scss())
        .pipe(minifyCSS())
        .pipe(dest('dist/css'));
}

module.exports = goscss